package libsys.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import libsys.general.LIBSYSSystem;

public class CalculatorButtonListener implements ActionListener
{
		public LIBSYSSystem LibrarySystem;
		
		public CalculatorButtonListener(LIBSYSSystem LibrarySystem)
		{
				this.LibrarySystem = LibrarySystem;
		}
		
		public void actionPerformed(ActionEvent ae)
		{
		
				if(ae.getActionCommand()=="0")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"0");
				}

				if(ae.getActionCommand().equals("1"))
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText() + "1");
				}
				
				if(ae.getActionCommand()=="2")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"2");
				}
				
				if(ae.getActionCommand()=="3")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"3");
				}
				
				if(ae.getActionCommand()=="4")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"4");
				}
				
				if(ae.getActionCommand()=="5")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"5");
				}
				
				if(ae.getActionCommand()=="6")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"6");
				}
				
				if(ae.getActionCommand()=="7")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"7");
				}
				
				if(ae.getActionCommand()=="8")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"8");
				}
				
				if(ae.getActionCommand()=="9")
				{
						LibrarySystem.FrameItems.calculatorFrameItems.result_txt.setText(LibrarySystem.FrameItems.calculatorFrameItems.result_txt.getText()+"9");
				}
		}
				
				
}